package com.tueye.entity;

import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *  
 * @author yue
 * descript: the picture of topics
 */
@Entity
@Table(name = "tueye_pictures_info")
public class Pictures extends BaseEntity {
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -5271232994248502636L;
	private String picture_name;
	private String picture_description;
	private String picture_url;
	//if main_picture the value is 1
	//else the value is 2
	private Integer main_picture;
	 
	
	private Topics topics;
	
	private List<Comment> comments ;
	
	@ManyToOne
	public Topics getTopics() {
		return topics;
	}
	public void setTopics(Topics topics) {
		this.topics = topics;
	}
	public String getPicture_name() {
		return picture_name;
	}
	public void setPicture_name(String picture_name) {
		this.picture_name = picture_name;
	}
	public String getPicture_description() {
		return picture_description;
	}
	public void setPicture_description(String picture_description) {
		this.picture_description = picture_description;
	}
	public String getPicture_url() {
		return picture_url;
	}
	public void setPicture_url(String picture_url) {
		this.picture_url = picture_url;
	}
	public Integer getMain_picture() {
		return main_picture;
	}
	public void setMain_picture(Integer main_picture) {
		this.main_picture = main_picture;
	}
	@OneToMany(mappedBy ="picture",cascade=CascadeType.ALL)
	public List<Comment> getComments() {
		return comments;
	}
	public void setComments(List<Comment> comments) {
		this.comments = comments;
	}
	 

	
	 
}